#line 1 "D:/Desktop/PSM/coding 877a/Test_Uart/Test_Uart.c"
int receive;

void usart_str(char *s)
{
 while(*s){usart_write(*s++);}
}

void main()
{
 Usart_Init(9600);
 TRISB=0b00000011;

 while(1)
 {
 if(!portb.f0)
 {
 portb.f7=1;
 Usart_str("stop");
 delay_ms(200);
 }
 if (Usart_Data_Ready()) {receive = Usart_Read();}

 while(receive){usart_write(receive);receive=0;}

 }
}
